﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MarketOnlineDAO;
using MarketOnlineDTO;

namespace MarketOnlineBUS
{
    public class SanPhamBUS
    {
        public List<SanPhamDTO> LayDanhSachSanPham()
        {
            return new SanPhamDAO().LayDanhSachSanPham();
        }

        public List<SanPhamDTO> LayDanhSachSanPhamMoi()
        {
            return new SanPhamDAO().LayDanhSachSanPhamMoi();
        }

        public List<SanPhamDTO> LayDanhSachSanPhamHetHang()
        {
            return new SanPhamDAO().LayDanhSachSanPhamHetHang();
        }

        public SanPhamDTO LaySanPham(int MaSanPham)
        {
            return new SanPhamDAO().LaySanPham(MaSanPham);
        }

        public Boolean ThemSanPham(SanPhamDTO dto)
        {
            return new SanPhamDAO().ThemSanPham(dto);
        }

        public Boolean CapNhatSanPham(SanPhamDTO dto)
        {
            return new SanPhamDAO().CapNhatSanPham(dto);
        }

        public Boolean XoaSanPham(int MaSanPham)
        {
            return new SanPhamDAO().XoaSanPham(MaSanPham);
        }

        public List<SanPhamDTO> LaySanPhamTheoLoai(int MaLoaiSP, int limit)
        {
            return new SanPhamDAO().LaySanPhamTheoLoai(MaLoaiSP,limit);
        }
        public List<SanPhamDTO> TimKiemSanPham(String key_search)
        {
            List<SanPhamDTO> list = new List<SanPhamDTO>();
            SanPhamDAO spDAO=new SanPhamDAO();
            list = spDAO.TimKiemSanPham(key_search);
            return list;
        }

    }
}
